plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'kotlin-parcelize'
    id 'kotlin-kapt'
    id 'kotlin-android'
}

android {
    namespace 'com.geekbrains.tests'
    compileSdk 33

    defaultConfig {
        applicationId "com.geekbrains.tests"
        minSdkVersion 21
        targetSdkVersion 33
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        testInstrumentationRunnerArguments clearPackageData: 'true'

    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    testOptions {
        unitTests {
            includeAndroidResources = true
        }
    }

    buildFeatures {
        viewBinding = true
    }
    flavorDimensions 'version'
    productFlavors {
        fake {
            dimension 'version'
            versionNameSuffix '.fake'
        }
        real {
            dimension 'version'
            versionNameSuffix '.real'
        }
    }

    sourceSets {

        androidTest {
            java.srcDirs += "src/sharedTestData/java"
        }
        test {
            java.srcDirs += "src/sharedTestData/java"
        }
    }
}


dependencies {
    implementation 'androidx.fragment:fragment-ktx:1.6.1'
    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'androidx.core:core-ktx:1.10.1'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.9.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'androidx.recyclerview:recyclerview:1.3.0'
    //Test
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

    //Mockito
    testImplementation "org.mockito:mockito-core:5.3.1"
    testImplementation 'org.mockito:mockito-inline:2.8.9'
    testImplementation('com.nhaarman:mockito-kotlin:1.5.0') {
        exclude group: 'org.jetbrains.kotlin'
        exclude group: 'org.mockito'
    }
    //Robolectric
    testImplementation "org.robolectric:robolectric:4.10.3"
    androidTestImplementation "org.robolectric:shadows-framework:4.10.3"
    testImplementation 'androidx.test:core:1.5.0'
    testImplementation 'androidx.test:runner:1.5.2'
    testImplementation 'androidx.test.ext:junit:1.1.5'
    testImplementation 'androidx.test.ext:truth:1.5.0'

    //Dagger
    implementation 'com.google.dagger:dagger:2.46.1'
    kapt 'com.google.dagger:dagger-compiler:2.46.1'
    kapt 'com.google.dagger:dagger-android-processor:2.46.1'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.46.1'

    //UI Automator
    androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'

}
